CREATE table "USERS" (
    "IDUSER"     NUMBER NOT NULL,
    "IDROLE"     NUMBER,
    "NICK"       VARCHAR2(30) NOT NULL,
    "PASSWORD"   VARCHAR2(30),
    "FIRSTNAME"  VARCHAR2(30),
    "LASTNAME"   VARCHAR2(30),
    "ACTIVATE"   CHAR(1),
    constraint  "USERS_PK" primary key ("IDUSER")
)
/

CREATE sequence "USERS_SEQ" 
/

CREATE trigger "BI_USERS"  
  before insert on "USERS"              
  for each row 
begin  
    select "USERS_SEQ".nextval into :NEW.IDUSER from dual;
end;
/   

